# 6. 密码输入检测
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on('line', (input) => {
let res = '';
let isBig = false;
let isSmall = false;
let isNum = false;
let isSpec = false;
for(let i=0; i<input.length; i++) {
if (input[i] === '<') {
res = res.slice(0, -1);
} else {
res += input[i];
}
}
for (let i=0; i<res.length; i++) {
if (/[0-9]/.test(res[i])) {
isNum = true;
} else if (/[a-z]/.test(res[i])) {
isSmall = true;
} else if (/[A-Z]/.test(res[i])) {
isBig = true;
} else if (res[i]) {
isSpec = true;
}
}
let flag = res.length >= 8 && isNum && isSmall && isBig && isSpec;
console.log(res + ',' + flag);
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34